From 5e99646e1c053e34265439ae231121de880a1d48 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 26 Mar 2018 18:32:38 +0200 Subject: [PATCH] dnd: Remove gtk_drag_set_icon_surface() All users are gone. Use gtk_drag_set_icon_paintable() instead. --- docs/reference/gtk/gtk4-sections.txt | 1 - gtk/gtkdnd.c | 36 ---------------------------- gtk/gtkdnd.h | 3 --- 3 files changed, 40 deletions(-) diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt index 64603bc925..83d091b693 100644 --- a/docs/reference/gtk/gtk4-sections.txt +++ b/docs/reference/gtk/gtk4-sections.txt @@ -4993,7 +4993,6 @@ gtk_drag_unhighlight gtk_drag_begin_with_coordinates gtk_drag_cancel gtk_drag_set_icon_widget -gtk_drag_set_icon_surface gtk_drag_set_icon_paintable gtk_drag_set_icon_name gtk_drag_set_icon_gicon diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index 80c8c73e13..53bfac3569 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -1175,42 +1175,6 @@ gtk_drag_set_icon_definition (GdkDragContext *context, set_icon_helper (context, def, hot_x, hot_y); } -/** - * gtk_drag_set_icon_surface: - * @context: the context for a drag (This must be called - * with a context for the source side of a drag) - * @surface: the surface to use as icon - * - * Sets @surface as the icon for a given drag. GTK+ retains - * references for the arguments, and will release them when - * they are no longer needed. - * - * To position the surface relative to the mouse, use - * cairo_surface_set_device_offset() on @surface. The mouse - * cursor will be positioned at the (0,0) coordinate of the - * surface. - */ -void -gtk_drag_set_icon_surface (GdkDragContext *context, - cairo_surface_t *surface) -{ - GtkWidget *widget; - double hot_x, hot_y; - GdkTexture *texture; - - g_return_if_fail (GDK_IS_DRAG_CONTEXT (context)); - g_return_if_fail (surface != NULL); - - cairo_surface_get_device_offset (surface, &hot_x, &hot_y); - cairo_surface_set_device_offset (surface, 0, 0); - - texture = gdk_texture_new_for_surface (surface); - widget = gtk_image_new_from_paintable (GDK_PAINTABLE (texture)); - g_object_unref (texture); - - gtk_drag_set_icon_widget_internal (context, widget, (int)hot_x, (int)hot_y, TRUE); -} - /** * gtk_drag_set_icon_paintable: * @context: the context for a drag (This must be called diff --git a/gtk/gtkdnd.h b/gtk/gtkdnd.h index 58b2aca5f9..c6aa57743b 100644 --- a/gtk/gtkdnd.h +++ b/gtk/gtkdnd.h @@ -76,9 +76,6 @@ void gtk_drag_set_icon_widget (GdkDragContext *context, gint hot_x, gint hot_y); GDK_AVAILABLE_IN_ALL -void gtk_drag_set_icon_surface(GdkDragContext *context, - cairo_surface_t *surface); -GDK_AVAILABLE_IN_ALL void gtk_drag_set_icon_paintable (GdkDragContext *context, GdkPaintable *paintable, int hot_x, -- 2.30.2